// Example file demonstrating the use of the BUF and STREAM commands
// to send GENERIC_LONG_WRITE packet with CRC error
//
// The BUF command defines a buffer that holds data bytes, often
// associated with a packet.  The special data command codes for auto-ECC,
// auto-WordCnt, auto-CRC are supported during its definition.
//
// Once defined, individual buffer elements can be accessed and modified
// using variable assignment syntax.  They can also be used like any
// other variable in expressions for arguments, variable assignments, 
// replication counts, or data values.
//
// In addition, the buffer variable by itself can be used in the ASSERT, 
// MSGBOX, STREAM, and SAVE_BUF commands.  In these cases, all data values
// in the array are passed to the command.
//
// The STREAM command causes data from its buffer argument to be output as
// data for the current command.  Its syntax is:
//
// # STREAM <bufname> [<startIndex> <length>]
//
// The optional arguments define the range of buffer data to be output.
// This is useful, for example, when the buffer contains frame data, 
// allowing access to line data while looping.

# FILE "../DSIDataTypes.txt"

// define buffer with DSI packet
# BUF pkt
DT_GENERIC_LONG_WRITE -4 -1 1 2 3 4 -2

// invert bit in payload to cause error
// (CRC has already been calculated)
# pkt[4] = pkt[4] ^ 10h

// display packet data to user
# MSGBOX "Packet data: " pkt

// send HS packet with CRC error
# HS_PACKET
# STREAM pkt													


